Release 10.1A: OpenEdge Development:
Web Services


Invoking a method with a TABLE-HANDLE parameter (RPC/Encoded)

To invoke a method that passes a TABLE-HANDLE parameter:

This is the Progress 4GL prototype for a sample method, dynttIO( ), that passes a TABLE-HANDLE parameter:

Progress 4GL prototype that passes a TABLE-HANDLE parameter
/* dynttIO.p */ 
DEFINE INPUT-OUTPUT PARAMETER TABLE-HANDLE ttHandle.  

This is the RPC/Encoded WSDL sample definition for the dynttIO( ) method request message, which also defines a TABLE-HANDLE parameter (ttHandle). The parameter’s type is the standard TABLE-HANDLE parameter definition (TableHandleParam) specified in the Types section of the WSDL:

RPC/Encoded WSDL definition for TABLE-HANDLE parameter, ttHandle
<message name="DynTT_dynttIO"> 
   <part name="ttHandle" type="S2:TableHandleParam"/> 
</message> 

The following WSDL sample shows the definition for TableHandleParam, used for all dynamic TABLE-HANDLE parameters:

TABLE-HANDLE definition for all TABLE-HANDLE parameters
<complexType name="TableHandleParam"> 
   <sequence> 
      <any namespace="##local"/> 
   </sequence> 
</complexType> 

This is the declaration for a VB.NET client interface method (dynTTIO( )) which has a TABLE-HANDLE parameter, ttHandle, as a VB.NET object:

VB.NET declaration of interface method passing TABLE-HANDLE, ttHandle
Public Sub dynttIO(ByRef ttHandle As Object) 

The following VB.NET client code passes the dyntt object representing a TABLE-HANDLE to the dynttIO( ) method:

VB.NET client code passing TABLE-HANDLE, ttHandle, to interface method
Dim dyntt as Object 
’... Code to build up the dyntt Object (XML Schema and data) 
webService.dynttIO(dyntt) 

For more information on how you might manage TABLE-HANDLE parameters in VB.NET, see the subsections on handling TABLE-HANDLE parameters in Chapter A, "Developing a .NET Client to Access Progress 4GL Web Services," and in Java see the subsections on handling TABLE-HANDLE parameters in Chapter B, " Developing a Java Client to Access Progress 4GL Web Services."

This is the structure of the RPC/Encoded SOAP request message that the sample dynttIO method sends to pass a dynamic temp-table that you create for the ttHandle TABLE-HANDLE parameter (see the "Invoking a method with a TABLE-HANDLE parameter (RPC/Encoded)" section):

SOAP request (RPC/Encoded) for TABLE-HANDLE, ttHandle
<?xml version="1.0" encoding="utf-8" ?>  
<soap:Envelope namespaces defined here...>  
  <soap:Header .../>  
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">  
    <q1:dynttIO xmlns:q1="urn:DynTTSrvc:DynTT">  
      <ttHandle>  
        <DataSet xmlns=""> 
          <schema> 
            <!-- Schema definition goes here --> 
          </schema> 
          <Data> 
            <!-- Data goes here --> 
          </Data> 
        </DataSet> 
      </ttHandle> 
    </q1:dynttIO> 
  </soap:Body> 
</soap:Envelope> 

The ttHandle TABLE-HANDLE parameter becomes an XML <ttHandle> element containing the <DataSet> element that contains the schema and the data.

Note: Not shown is any required object ID that must be sent in the SOAP header for the object on which dynttIO( ) is invoked.

This is a sample XML Schema created by VB.NET for the TABLE-HANDLE contained by the sample <DataSet> element in the sample RPC/Encoded SOAP request:

TABLE-HANDLE <schema> element for an RPC/Encoded SOAP request
<xs:schema id="Data" xmlns="" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> 
  <xs:element name="Data" msdata:IsDataSet="true"> 
    <xs:complexType>  
      <xs:choice maxOccurs="unbounded"> 
        <xs:element name="Item"> 
          <xs:complexType> 
            <xs:sequence> 
             <xs:element name="Name" type="xs:string" 
                           minOccurs="0"/> 
             <xs:element name="Number" type="xs:int" 
                           minOccurs="0"/> 
            </xs:sequence> 
          </xs:complexType> 
        </xs:element> 
      </xs:choice> 
    </xs:complexType> 
  </xs:element> 
</xs:schema> 

Note the definition of the <Data> element containing the data for the table, and how the column type information is specified within the <Item> element.

This is a sample <Data> element you would create to accompany the specified schema in the sample RPC/Encoded SOAP request, including the column values for the two rows initialized in the sample VB.NET code:

TABLE-HANDLE <Data> element for an RPC/Encoded SOAP request
<Data>  
  <Item>  
    <Name>Fred</Name>  
    <Number>1</Number>  
  </Item>  
  <Item>  
    <Name>Barney</Name>  
    <Number>2</Number>  
  </Item>  
</Data>  


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095